set more off
capture log close
cd *** Fill in path name here ***

//  program:    AnanatEtAl_suicidality results
//  task:		Regressions of suicidal ideation on job loss -- including time-varying covariates

log using *** Fill in file name here ***, replace text

// Run this sensitivity check for black youth only 

// #1
// Load data
use AnanatEtAl_suicidality_data.dta, clear

keep if black == 1

// #2
// Indicate data is weighted
svyset psu [pweight=weight], strata(stratum)  singleunit(certainty) 

// #3
// Run IV-probit regressions, addressing the complex survey design, black youth only
// Including unemployment, state GDP, state poverty rate, and mortgage delinquency rate as additional predictors
// Measured in the same year as job losses

svy: ivprobit suicthtly (seppctyrlag = ticpctyrlag) Percentpov_histpov_lag z_gdplag unemplag fctotyearlg age female yrd* std*
margins, dydx (seppctyrlag) predict (pr)

clear

log close
